package org.springblade.modules.repair.vo.statistics;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;


/**
 * @Description
 * @Author ysq
 * @Date 2022/9/2
 **/
@Data
public class WorkTimeDetailVO {

	@ApiModelProperty(value = "名称")
	private String name;

	@ApiModelProperty(value = "作业天数")
	private Long workDayCount;

	@ApiModelProperty(value = "日均作业时长")
	private BigDecimal divDayWorkTime;

	@ApiModelProperty(value = "保养作业累计时长")
	private BigDecimal byWorkTimeTotal;

	@ApiModelProperty(value = "维修作业累计时长")
	private BigDecimal wxWorkTimeTotal;

	@ApiModelProperty(value = "配件作业累计时长")
	private BigDecimal pjWorkTimeTotal;

	@ApiModelProperty(value = "作业累计时长")
	private BigDecimal totalWorkHour;

	public void setDivDayWorkTime(Integer divDayWorkTime) {
		this.divDayWorkTime = new BigDecimal(divDayWorkTime).divide(new BigDecimal("60"), 2, BigDecimal.ROUND_HALF_UP);
	}

	public void setByWorkTimeTotal(Integer byWorkTimeTotal) {
		this.byWorkTimeTotal = new BigDecimal(byWorkTimeTotal).divide(new BigDecimal("60"), 2, BigDecimal.ROUND_HALF_UP);
	}

	public void setWxWorkTimeTotal(Integer wxWorkTimeTotal) {
		this.wxWorkTimeTotal = new BigDecimal(wxWorkTimeTotal).divide(new BigDecimal("60"), 2, BigDecimal.ROUND_HALF_UP);
	}

	public void setPjWorkTimeTotal(Integer pjWorkTimeTotal) {
		this.pjWorkTimeTotal = new BigDecimal(pjWorkTimeTotal).divide(new BigDecimal("60"), 2, BigDecimal.ROUND_HALF_UP);
	}

	public void setTotalWorkHour(Integer totalWorkHour) {
		this.totalWorkHour = new BigDecimal(totalWorkHour).divide(new BigDecimal("60"), 2, BigDecimal.ROUND_HALF_UP);
	}

	public BigDecimal getTotalWorkHour() {
		if (this.totalWorkHour == null) {
			this.totalWorkHour = BigDecimal.ZERO.setScale(2);
		}
		return totalWorkHour;
	}

	public Long getWorkDayCount() {
		if (this.workDayCount == null) {
			this.workDayCount = 0L;
		}
		return workDayCount;
	}

	public BigDecimal getDivDayWorkTime() {
		if (this.divDayWorkTime == null) {
			this.divDayWorkTime = BigDecimal.ZERO.setScale(2);
		}
		return divDayWorkTime;
	}

	public BigDecimal getByWorkTimeTotal() {
		if (this.byWorkTimeTotal == null) {
			this.byWorkTimeTotal = BigDecimal.ZERO.setScale(2);
		}
		return byWorkTimeTotal;
	}

	public BigDecimal getWxWorkTimeTotal() {
		if (this.wxWorkTimeTotal == null) {
			this.wxWorkTimeTotal = BigDecimal.ZERO.setScale(2);
		}
		return wxWorkTimeTotal;
	}

	public BigDecimal getPjWorkTimeTotal() {
		if (this.pjWorkTimeTotal == null) {
			this.pjWorkTimeTotal = BigDecimal.ZERO.setScale(2);
		}
		return pjWorkTimeTotal;
	}
}
